package com.ruoyi.fitsculpt.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fitsculpt.mapper.EasyfitExercisesMapper;
import com.ruoyi.fitsculpt.domain.EasyfitExercises;
import com.ruoyi.fitsculpt.service.IEasyfitExercisesService;

/**
 * 运动库Service业务层处理
 *
 * @author metaee
 * @date 2025-02-27
 */
@Service
public class EasyfitExercisesServiceImpl implements IEasyfitExercisesService {
    @Autowired
    private EasyfitExercisesMapper easyfitExercisesMapper;

    /**
     * 查询运动库
     *
     * @param exerciseId 运动库主键
     * @return 运动库
     */
    @Override
    public EasyfitExercises selectEasyfitExercisesByExerciseId(Long exerciseId) {
        return easyfitExercisesMapper.selectEasyfitExercisesByExerciseId(exerciseId);
    }

    /**
     * 查询运动库列表
     *
     * @param easyfitExercises 运动库
     * @return 运动库
     */
    @Override
    public List<EasyfitExercises> selectEasyfitExercisesList(EasyfitExercises easyfitExercises) {
        return easyfitExercisesMapper.selectEasyfitExercisesList(easyfitExercises);
    }

    /**
     * 新增运动库
     *
     * @param easyfitExercises 运动库
     * @return 结果
     */
    @Override
    public int insertEasyfitExercises(EasyfitExercises easyfitExercises) {
        easyfitExercises.setCreateTime(DateUtils.getNowDate());
        return easyfitExercisesMapper.insertEasyfitExercises(easyfitExercises);
    }

    /**
     * 修改运动库
     *
     * @param easyfitExercises 运动库
     * @return 结果
     */
    @Override
    public int updateEasyfitExercises(EasyfitExercises easyfitExercises) {
        easyfitExercises.setUpdateTime(DateUtils.getNowDate());
        return easyfitExercisesMapper.updateEasyfitExercises(easyfitExercises);
    }

    /**
     * 批量删除运动库
     *
     * @param exerciseIds 需要删除的运动库主键
     * @return 结果
     */
    @Override
    public int deleteEasyfitExercisesByExerciseIds(Long[] exerciseIds) {
        return easyfitExercisesMapper.deleteEasyfitExercisesByExerciseIds(exerciseIds);
    }

    /**
     * 删除运动库信息
     *
     * @param exerciseId 运动库主键
     * @return 结果
     */
    @Override
    public int deleteEasyfitExercisesByExerciseId(Long exerciseId) {
        return easyfitExercisesMapper.deleteEasyfitExercisesByExerciseId(exerciseId);
    }
}
